import Vue from 'vue'
import 'babel-polyfill'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import MetaInfo from 'vue-meta-info'
// markdown样式
import 'github-markdown-css'
// 代码高亮
import 'highlight.js/styles/github.css'

import XEUtils from 'xe-utils'
// 按需导入
import { VXETable, Grid, Header, Toolbar, Form, Button, Table, Pager, Select, Tooltip, Input, Icon, FormItem, Footer, Modal } from 'vxe-table'
import zhCN from 'vxe-table/lib/locale/lang/zh-CN'
VXETable.setup({
  i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCN, key), args),
  size: 'mini'
})
Vue.use(Grid)
  .use(Header)
  .use(Toolbar)
  .use(Form)
  .use(Button)
  .use(Table)
  .use(Pager)
  .use(Select)
  .use(Tooltip)
  .use(Input)
  .use(Tooltip)
  .use(Icon)
  .use(FormItem)
  .use(Footer)
  .use(Modal)
  .use(MetaInfo)

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import dataV from '@jiaminghi/data-view' // 引入dataV

import GlobalComponent from './global-components/index'

import '@/permission' // permission control

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}

import VideoPlayer from 'vue-video-player'
import 'video.js/dist/video-js.css'
import 'vue-video-player/src/custom-theme.css'

Vue.use(VideoPlayer)
Vue.use(GlobalComponent, store, router)
Vue.use(ElementUI, { size: 'small' })
Vue.use(dataV)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: (h) => h(App)
})
